package linkwechat.controller.system;

import linkwechat.mapper.system.SysUserPostMapper;
import linkwechat.mapper.system.SysUserRoleMapper;
import linkwechat.pojo.LinkRole;
import linkwechat.pojo.ReturnData;
import linkwechat.pojo.SysPost;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RequestMapping("sysUserCount")
@RestController
public class SysUserCountControlller {

    @Resource
    SysUserRoleMapper sysUserRoleMapper;

    @Resource
    SysUserPostMapper sysUserPostMapper;


    //   根据用户id查询角色
    @RequestMapping("selectRole")
    public ReturnData selectRoleByUserId(Long userId){
        List<LinkRole> linkRoles = sysUserRoleMapper.selectRoleByUserId(userId);
        return ReturnData.respSuccess(linkRoles);
    }

    //   根据用户id查询岗位
    @RequestMapping("selectPost")
    public ReturnData selectPostByUserId(Long userId){
        List<SysPost> linkRoles = sysUserPostMapper.selectPostByUserId(userId);
        return ReturnData.respSuccess(linkRoles);
    }


}
